﻿using System.ComponentModel.DataAnnotations;
using System.Data;
using System.IO;
using VisionCloud.Utility;

namespace VisionCloud.Core.Model.Ms
{
    public class ModelingTaskDataDto : SurfaceTaskDataDto
    {
        private static readonly string _modelingDataPath = ConfigHelper.GetValue<string>("TaskModelingData");

        /// <summary>
        /// CSMstask表的ResultDataFilePath字段的值【不用传】
        /// </summary>
        public string ResultDataFilePath { get => Path.Combine(_modelingDataPath, MinioPath); }
    }

    public class ExternalWallTaskDataDto : SurfaceTaskDataDto
    {
        private static readonly string _taskResultDataPath = ConfigHelper.GetValue<string>("TaskResultData");

        /// <summary>
        /// CSMstask表的ResultDataFilePath字段的值【不用传】
        /// </summary>
        public string ResultDataFilePath { get => Path.Combine(_taskResultDataPath, MinioPath); }
    }

    public class SurfaceTaskDataDto
    {
        /// <summary>
        /// 任务相关数据表内容
        /// </summary>
        [Required(ErrorMessage = "缺失任务相关数据表内容")]
        public DataSet TaskDataset { get; set; }

        /// <summary>
        /// 设备编号
        /// </summary>
        [Required(ErrorMessage = "缺失设备编号")]
        public string DeviceNo { get; set; }

        /// <summary>
        /// minio相对路径
        /// </summary>
        [Required(ErrorMessage = "缺失minio相对路径")]
        public string MinioPath { get; set; }
    }
}